<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>工单管理</title>
    <link rel="stylesheet" href="<?=adminassets?>assets/pear/component/pear/css/pear.css" />
    <style>
        .pear-container { padding: 10px; background: #f2f2f2; }
        .layui-tab { margin: 0; border: none; }
        .layui-form-item { margin-bottom: 15px; }
        .layui-card { background: #fff; margin-bottom: 10px; border-radius: 4px; }
        .layui-card-body { padding: 15px; }
        .layui-textarea {
            min-height: 100px;
            border: 1px solid #e6e6e6;
            border-radius: 2px;
        }
        .settings-row {
            display: flex;
            gap: 20px;
            margin-bottom: 15px;
        }
        .settings-col {
            flex: 1;
        }
        .settings-actions {
            padding-top: 10px;
        }
        .pear-btn {
            height: 32px;
            line-height: 32px;
            padding: 0 16px;
            font-size: 13px;
            background: #2B9AFE;
            color: #fff;
            border: none;
            border-radius: 2px;
        }
    </style>
</head>
<body class="pear-container">
    <?php if ($my == "list") : ?>
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                <ul class="layui-tab-title">
                    <li class="layui-this">工单一览</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <div class="settings-row">
                            <div class="settings-col">
                                <label>工单类型设置</label>
                                <textarea id="pay_work_name" placeholder="请输入工单类型" class="layui-textarea"><?php echo $this->conf['pay_work_name']; ?></textarea>
                            </div>
                            <div class="settings-col">
                                <label>系统状态</label>
                                <select id="work_zt" class="layui-input" default="<?php echo $this->conf['work_zt'] ?>">
                                    <option value="1" <?= $this->conf['work_zt'] == 1 ? "selected" : "" ?>>开启</option>
                                    <option value="0" <?= $this->conf['work_zt'] == 0 ? "selected" : "" ?>>关闭</option>
                                </select>
                                <div class="settings-actions">
                                    <button id="submitSys" class="pear-btn">
                                        <i class="layui-icon layui-icon-ok"></i> 更新配置
                                    </button>
                                </div>
                            </div>
                        </div>
                        <table id="news" lay-filter="news"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script type="text/html" id="active">
        {{# if(d.active == 1){ }} 
        <button class="pear-btn pear-btn-sm"><i class="layui-icon layui-icon-ok"></i></button>
        {{# }else{ }}
        <button class="pear-btn pear-btn-danger pear-btn-sm"><i class="layui-icon layui-icon-close"></i></button>
        {{# } }}
    </script>

    <script type="text/html" id="options">
        <button class="pear-btn pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-release"></i></button>
        <button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i></button>
    </script>
    <?php endif; ?>
    <?php if ($my == "edit") : ?>
    <div class="layui-card">
        <div class="layui-card-body">
            <form class="layui-form" action="">
                <input type="hidden" name="id" value="<?= $id ?>" />
                <div class="layui-form-item">
                    <label class="layui-form-label">用户提问</label>
                    <div class="layui-input-block">
                        <textarea class="layui-textarea" readonly><?=$row['text']?></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">官方回复</label>
                    <div class="layui-input-block">
                        <textarea class="layui-textarea" name="huifu" <?= $readonly ?>><?= $row['huifu'] ?></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="submit" class="pear-btn" lay-submit lay-filter="editSave">
                            <i class="layui-icon layui-icon-ok"></i> 提交回复
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <?php endif; ?>

<script src="<?=adminassets?>assets/pear/component/layui/layui.js"></script>
<script src="<?=adminassets?>assets/pear/component/pear/pear.js"></script>
<script src="<?=adminassets?>assets/js/core_js/Work.js?v=<?=time()?>"></script>
</body>
</html>